<?php

/**
 * PlanRada form base class.
 *
 * @package    dnevnik
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BasePlanRadaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'skola_id'    => new sfWidgetFormPropelChoice(array('model' => 'Skola', 'add_empty' => true)),
      'predmet_id'  => new sfWidgetFormPropelChoice(array('model' => 'Predmet', 'add_empty' => false)),
      'profesor_id' => new sfWidgetFormPropelChoice(array('model' => 'Profesor', 'add_empty' => true)),
      'razred'      => new sfWidgetFormInput(),
      'red_br'      => new sfWidgetFormInput(),
      'opis'        => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'PlanRada', 'column' => 'id', 'required' => false)),
      'skola_id'    => new sfValidatorPropelChoice(array('model' => 'Skola', 'column' => 'id', 'required' => false)),
      'predmet_id'  => new sfValidatorPropelChoice(array('model' => 'Predmet', 'column' => 'id')),
      'profesor_id' => new sfValidatorPropelChoice(array('model' => 'Profesor', 'column' => 'id', 'required' => false)),
      'razred'      => new sfValidatorInteger(),
      'red_br'      => new sfValidatorInteger(),
      'opis'        => new sfValidatorString(array('max_length' => 200)),
    ));

    $this->widgetSchema->setNameFormat('plan_rada[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PlanRada';
  }


}
